#include "udpsend.h"
#include "ui_udpsend.h"

UdpSend::UdpSend(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::UdpSend)
{
    ui->setupUi(this);
}

UdpSend::~UdpSend()
{
    delete ui;
}

void UdpSend::on_pushButton_clicked()
{
    QString ip = ui->ipEdit->text();
    QString port = ui->portEdit->text();

    QString data = ui->textEdit->toPlainText();

    //发送数据
    msocket.writeDatagram(data.toUtf8(),QHostAddress(ip),port.toUShort());
}
